package com.ssy.lingxi.settle.accounts.model.vo.request;

import com.ssy.lingxi.settle.accounts.handler.annotation.DateStringFormatAnnotation;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 新增对账单行明细VO
 * @author Saske
 * @date 2021/12/20
 * @version 2.0.0
 */
public class ApplyAmountRowSaveVO implements Serializable {

    private static final long serialVersionUID = -88879609570038L;


    /**
     * 单据来源合同id, 如果没有传 0
     */
    @NotNull(message = "单据来源合同必须存在")
    @PositiveOrZero(message = "单据来源合同不能小于0")
    private Long sourceContractId;

    /**
     * 单据id
     */
    @NotNull(message = "单据ID不能为空")
    @Positive(message = "单据ID要大于0")
    private Long billId;

    /**
     * 单据编号
     */
    @NotBlank(message = "单据编号不能为空")
    private String billNo;

    /**
     * 单据摘要
     */
    @NotBlank(message = "单据摘要不能为空")
    private String billAbstract;

    /**
     * 单据类型，定义在 ApplyAmountRowBillTypeEnum 中
     */
    @NotNull(message = "单据类型不能为空")
    private Integer billType;

    /**
     * 订单类型名称
     */
    private String billTypeName;

    /**
     * 单据时间 日期格式必须为yyyy-MM-dd
     */
    @NotBlank(message = "单据时间不能为空")
    @DateStringFormatAnnotation(message = "单据时间日期格式不对")
    private String billTime;

    /**
     * 单据状态
     */
    @NotNull(message = "单据状态不能为空")
    private String billStatus;

    /**
     * 单据金额
     */
    @NotNull(message = "单据金额不能为空")
    private BigDecimal billAmount;

    /**
     * 单据行金额，非物料对账单请款时，必传，大于0，物料对账单请款时，非必传
     */
    @NotNull(message = "单据行金额")
    private BigDecimal billRowAmount;

    /**
     * 是否含税：
     * 定义：CommonBooleanEnum
     */
    @NotNull(message = "税率不能为空")
    private Integer hasTax;

    /**
     * 是否含税中文
     */
    private String hasTaxName;
    /**
     * 税率（百分比的分子部分）
     */
    @NotNull(message = "税率不能为空")
    @PositiveOrZero(message = "税率")
    private BigDecimal taxRate;

    /**
     * 已付款
     */
    @NotNull(message = "已付款不能为空")
    private BigDecimal paid;

    /**
     * 已请款待付款
     */
    @NotNull(message = "已请款待付款不能为空")
    private BigDecimal appliedUnpaid;

    /**
     * 对账金额，没有就传0
     */
    @NotNull(message = "对账金额不能为空")
    private BigDecimal reconciliationAmount;

    /**
     * 请款金额要大于0
     */
    @NotNull(message = "请款金额不能为空")
    private BigDecimal applyPayment;

    /**
     * 核销金额, 必传传值，没有就传 0
     */
    @NotNull(message = "核销金额不能为空")
    @PositiveOrZero(message = "核销金额要大于0")
    private BigDecimal writeOffAmount;

    /**
     * 可以核销标识
     */
    private Boolean canWriteOffFlag;
    /**
     * 核销记录
     */
    private List<ApplyAmountRowWriteOffRecordSaveVO> writeOffRecords;

    public Long getBillId() {
        return billId;
    }

    public void setBillId(Long billId) {
        this.billId = billId;
    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    public String getBillAbstract() {
        return billAbstract;
    }

    public void setBillAbstract(String billAbstract) {
        this.billAbstract = billAbstract;
    }

    public Integer getBillType() {
        return billType;
    }

    public void setBillType(Integer billType) {
        this.billType = billType;
    }

    public String getBillTime() {
        return billTime;
    }

    public void setBillTime(String billTime) {
        this.billTime = billTime;
    }

    public String getBillStatus() {
        return billStatus;
    }

    public void setBillStatus(String billStatus) {
        this.billStatus = billStatus;
    }

    public BigDecimal getBillAmount() {
        return billAmount;
    }

    public void setBillAmount(BigDecimal billAmount) {
        this.billAmount = billAmount;
    }

    public BigDecimal getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(BigDecimal taxRate) {
        this.taxRate = taxRate;
    }

    public BigDecimal getPaid() {
        return paid;
    }

    public void setPaid(BigDecimal paid) {
        this.paid = paid;
    }

    public BigDecimal getAppliedUnpaid() {
        return appliedUnpaid;
    }

    public void setAppliedUnpaid(BigDecimal appliedUnpaid) {
        this.appliedUnpaid = appliedUnpaid;
    }

    public BigDecimal getReconciliationAmount() {
        return reconciliationAmount;
    }

    public void setReconciliationAmount(BigDecimal reconciliationAmount) {
        this.reconciliationAmount = reconciliationAmount;
    }

    public BigDecimal getApplyPayment() {
        return applyPayment;
    }

    public void setApplyPayment(BigDecimal applyPayment) {
        this.applyPayment = applyPayment;
    }

    public BigDecimal getWriteOffAmount() {
        return writeOffAmount;
    }

    public void setWriteOffAmount(BigDecimal writeOffAmount) {
        this.writeOffAmount = writeOffAmount;
    }

    public List<ApplyAmountRowWriteOffRecordSaveVO> getWriteOffRecords() {
        return writeOffRecords;
    }

    public void setWriteOffRecords(List<ApplyAmountRowWriteOffRecordSaveVO> writeOffRecords) {
        this.writeOffRecords = writeOffRecords;
    }

    public Long getSourceContractId() {
        return sourceContractId;
    }

    public void setSourceContractId(Long sourceContractId) {
        this.sourceContractId = sourceContractId;
    }

    public BigDecimal getBillRowAmount() {
        return billRowAmount;
    }

    public void setBillRowAmount(BigDecimal billRowAmount) {
        this.billRowAmount = billRowAmount;
    }

    public String getBillTypeName() {
        return billTypeName;
    }

    public void setBillTypeName(String billTypeName) {
        this.billTypeName = billTypeName;
    }

    public Integer getHasTax() {
        return hasTax;
    }

    public void setHasTax(Integer hasTax) {
        this.hasTax = hasTax;
    }

    public String getHasTaxName() {
        return hasTaxName;
    }

    public void setHasTaxName(String hasTaxName) {
        this.hasTaxName = hasTaxName;
    }

    public Boolean getCanWriteOffFlag() {
        return canWriteOffFlag;
    }

    public void setCanWriteOffFlag(Boolean canWriteOffFlag) {
        this.canWriteOffFlag = canWriteOffFlag;
    }
}
